import type { BasicTableColumn } from '@/components/table';
import type { FormSchema } from '@/components/form';
import type { BasicTableProps } from '@/components/table/src/props';
import type { BasicFormProps } from '@/components/form/src/props';
import type { DataActionButtons, ToolbarActionButtons } from '@/components/crud';

export interface BasicCrudProps extends
  Omit<BasicTableProps, 'columns'>,
  Omit<BasicFormProps, 'schemas'> {
  /**
   * 是否可搜索
   */
  searchable?: boolean;
  /**
   * 表格列
   */
  tableColumns: BasicTableColumn[];
  /**
   * 表单Schema
   */
  formSchemas: FormSchema[];
  /**
   * 搜索Schema
   */
  searchSchemas?: FormSchema[];
  /**
   * 创建请求
   */
  createRequest?: Function;
  /**
   * 创建之前
   */
  beforeCreate?: Function;
  /**
   * 修改请求
   */
  modifyRequest?: Function;
  /**
   * 删除请求
   */
  deleteRequest?: Function;
  /**
   * 弹窗宽度
   */
  modalWidth?: number | string;
  /**
   * 主键字段
   */
  keyField?: string;
  /**
   * 工具栏按钮
   */
  toolbarActionButtons?: ToolbarActionButtons;
  /**
   * 数据操作按钮
   */
  dataActionButtons?: DataActionButtons;
}
